package com.wx_shop.api.controller.api;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

import com.wx_shop.api.comm.Constants;
import com.wx_shop.api.service.CmsPubService;
import com.wx_shop.api.vo.BaseRes;
import com.wx_shop.api.vo.ProductVo;

/**
 * 内容发部列表
 */
@Controller
@RequestMapping("api/cmsPub")
public class CmsPubRest {

	@Resource
	private CmsPubService cmsPubService;

	/**
	 * 首页滚动banner
	 * 
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "homeBannerList", method = RequestMethod.GET)
	public BaseRes<List<ProductVo>> homeBannerList() {
		return cmsPubService.fetchPubByType(Constants.HOME_BANNER_LIST);
	}

	/**
	 * 会员热购
	 * 
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "vipHotProduct", method = RequestMethod.GET)
	public BaseRes<List<ProductVo>> vipHotProduct() {
		return cmsPubService.fetchPubByType(Constants.VIP_HOT_BUY);
	}

	/**
	 * 新品推荐
	 * 
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "newProRecommend", method = RequestMethod.GET)
	public BaseRes<List<ProductVo>> newProRecommend() {
		return cmsPubService.fetchPubByType(Constants.NEW_PRO_RECOMMEND);
	}

	/**
	 * 首页楼层广告
	 * 
	 * @return
	 */
	@ResponseBody
	@RequestMapping(value = "homeAdColumnList", method = RequestMethod.GET)
	public BaseRes<List<ProductVo>> homeAdColumnList() {
		return cmsPubService.fetchPubByType(Constants.HOME_AD_COLUMN_LIST);
	}
	
}
